#ifndef WALKAWARE_SHARED_POINTCLOUD_H
#define WALKAWARE_SHARED_POINTCLOUD_H

#include <QSharedDataPointer>
#include <QMetaType>

#include <WalkaWare/Shared/Detail/PointCloudPrivate.h>

namespace WalkaWare
{

namespace Shared
{

class PointCloud
{
	public:

		typedef void       BaseType;
		typedef PointCloud ThisType;

		PointCloud(void)
		{
			this->d = new Detail::PointCloudPrivate();
		}

		PointCloud(const ThisType & other)
			: d(other.d)
		{
			;
		}

		void clear(void)
		{
			this->d->clear();
		}

		int size(void) const
		{
			return this->d->size();
		}

		bool isEmpty(void) const
		{
			return this->d->isEmpty();
		}

		void updateBoundingBox(void)
		{
			return this->d->updateBoundingBox();
		}

		const Box3f & boundingBox(void) const
		{
			return this->d->boundingBox();
		}

		Box3f & boundingBox(void)
		{
			return this->d->boundingBox();
		}

		const QVector<Vec3f> & points(void) const
		{
			return this->d->points();
		}

		QVector<Vec3f> & points(void)
		{
			return this->d->points();
		}

		const Vec3f & at(int index) const
		{
			return this->d->at(index);
		}

		Vec3f & at(int index)
		{
			return this->d->at(index);
		}

		const Vec3f & operator [] (int index) const
		{
			return (*(this->d))(index);
		}

		Vec3f & operator [] (int index)
		{
			return (*(this->d))(index);
		}

		const Vec3f & operator () (int index) const
		{
			return (*(this->d))(index);
		}

		Vec3f & operator () (int index)
		{
			return (*(this->d))(index);
		}

	protected:

		 QSharedDataPointer<Detail::PointCloudPrivate> d;
};

} // end namespace Shared

} // end namespace WalkaWare

Q_DECLARE_METATYPE(WalkaWare::Shared::PointCloud)

#endif // WALKAWARE_SHARED_POINTCLOUD_H
